/*------------------------------------------------------------------------------
$module:      lockers
$package:     CseApi
$purpose:     Windows implement for locker
$author:      WAYNE WORK STDIO
$CreateAt:    08/07/04
$LastModify:
$license:     Mozilla Public License Version 1.1
------------------------------------------------------------------------------*/

#include <windows.h>

#include "CseApi/platform.h"
#include "CseApi/lockers.h"

TCriticalSection::TCriticalSection()
{
    InitializeCriticalSection((LPCRITICAL_SECTION) m_critical.buff);
}

TCriticalSection::~TCriticalSection()
{
    DeleteCriticalSection((LPCRITICAL_SECTION) m_critical.buff);
}

void TCriticalSection::enter()
{
    EnterCriticalSection((LPCRITICAL_SECTION) m_critical.buff);
}

void TCriticalSection::leave()
{
    LeaveCriticalSection((LPCRITICAL_SECTION) m_critical.buff);
}
